﻿@{
    ViewBag.Title = "CanteenNonstapleFood";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Head
{
    @Html.Css("dp")
    @Html.Js("datepicker")
    <script type="text/javascript">
        var mainheight = document.documentElement.clientHeight;
        var mainWidth = document.documentElement.clientWidth - 10;
        $(document).ready(function () {
            $("#instockdt").datepicker({ picker: "<img class='picker' align='middle' src='Images/s.gif' alt=''/>" });
            var otherpm = $("#title").height() + $("#findDiv").height(); // 290;
            var gh = mainheight - otherpm - 80;
            var pyy = $("#outstockyy :selected").text();
            var option = {
                height: gh,
                width: mainWidth,
                url: '@Url.Action("GetCanteenNonstapleFood")',
                colModel: [
                    { display: '序号', name: 'ID', width: 30, sortable: false, align: 'left', hide: false, iskey: true },
                    { display: '日期', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '荤菜', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '蔬菜', width: 80, sortable: false, hide: false, align: 'left' },
			        { display: '鱼', width: 80, sortable: false, hide: false, align: 'left' },
                    { display: '合计', width: 50, sortable: false, hide: false, align: 'left' }
				],
                singleselected: true,
                sortname: "Sequence",
                sortorder: "asc",
                title: false,
                usepager: true,
                page: 1,
                rp: 20,
                rpOptions: [10, 15, 20],
                showcheckbox: true,
                rowbinddata: true,
                query: $("#outstockyy :selected").text() + "," + $("#outstockmm :selected").val() + ","
                        + $("#CanteenSel :selected").val()
            };
            $("#outstockinspection").flexigrid(option);

            $("#btnQueryList").click(function () {
                option.query = $("#outstockyy :selected").text() + "," + $("#outstockmm :selected").val() + ","
                        + $("#CanteenSel :selected").val();
                option.newp = 0;
                $("#outstockinspection").flexOptions(option).flexReload();
            });

            $("#btnExport").click(function () {
                var yy = $("#outstockyy :selected").text();
                var mm = $("#outstockmm :selected").val();
                var st = $("#CanteenSel :selected").val();
                var strulr = "EContentCanteenNon?yy=" + yy + "&mm=" + mm + "&st=" + st;
                var subwin = window.open(strulr, "", "menubar=no,toolbar=no,status=no,resizable=no,scrollbars=yes");
                subwin.moveTo(0, 0);
                subwin.resizeTo(window.screen.availWidth, window.screen.availHeight);
                return false;
            });

        });
    </script>
}
<div id="container">
    <div id="mainContent">
        <div id="title" class="title">
            食堂(荤菜,蔬菜,鱼)报表</div>
        <div id="findDiv">
            <table>
                <tr>
                    <td style="text-align: right; width: 80px;">
                        年份：
                    </td>
                    <td>@Html.DropDownList("outstockyy",
                                   ViewData["yy"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:80px; height:22px; font-size:13px;" })
                    </td>
                    <td style="text-align: right; width: 80px;">
                        月份：
                    </td>
                    <td>@Html.DropDownList("outstockmm",
                                   ViewData["mm"] as IEnumerable<SelectListItem>,
                                   new { @style = "width:80px; height:22px; font-size:13px;" })
                    </td>
                    <td style="text-align: right; width: 80px;">
                        食堂：
                    </td>
                    <td>@Html.DropDownList("CanteenSel",
                                        ViewData["canteen"] as SelectList,
                                   new { @style = "width:128px; height:22px; font-size:13px;" })
                    </td>
                    <td>
                        <a id="btnQueryList" class="button" href="javascript:void(0);"><span>查 询</span></a>
                        <a id="btnExport" class="button" href="javascript:void(0);"><span>导 出</span></a>
                    </td>
                </tr>
            </table>
        </div>
        <table id="outstockinspection" style="display: none;">
        </table>
    </div>
</div>
